Skip to content

Improve error model and serialization#44

Open
Quinn-With-Two-Ns wants to merge 2 commits intonexus-rpc:mainfrom
Quinn-With-Two-Ns:nexus-error-changes
Open

Improve error model and serialization#44
Quinn-With-Two-Ns wants to merge 2 commits intonexus-rpc:mainfrom
Quinn-With-Two-Ns:nexus-error-changes

Conversation

@Quinn-With-Two-Ns
Copy link
Contributor

Improve error model and serialization:

  • Add stack trace to FailureInfo
  • Allow OperationException to have a message
  • Allow HandlerException to have a message
  • Deprecate old constructors for HandlerException

@Quinn-With-Two-Ns Quinn-With-Two-Ns requested a review from a team as a code owner February 17, 2026 18:25
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b7fcca303

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@bergundy bergundy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with comments.

* @param causeMessage The cause message.
* @deprecated
*/
public HandlerException(ErrorType errorType, String causeMessage) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we should have a non deprecated constructor that will take just error type and message but I understand that this would break compatibility. In Go we managed to get around this by creating a new constructor but in Java I'm not sure how we might achieve that. Do you think we could remove this deprecated method and bring it back at some point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think we would remove this constructor in the future, I will add a note of this in the deprecated comment

* @param message The cancellation message.
* @return The operation exception.
*/
public static OperationException canceled(String message) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed we are inconsistent with the naming. I would choose failed and canceled over failure and canceled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree they are inconsistent, is the suggestion to deprecate the old failure constructor? We can't remove it due to backwards compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants